package com.han.flyweight;

/**
 * @ClassName Client
 * @Description 描述该类的功能
 * @Author duoduo Han
 * @Date 2024/6/13 11:03
 */
public class Client {
    public static void main(String[] args) {
        //获取I图形对象
        AbstractBox box1 = BoxFactory.getInstance().getShape("I");
        box1.display("red");

        //获取I图形对象
        AbstractBox box2 = BoxFactory.getInstance().getShape("L");
        box2.display("gray");

        AbstractBox box3 = BoxFactory.getInstance().getShape("I");
        box3.display("gray");


        System.out.println(box1 == box3);

    }
}
